package com.tudouji.project.mt.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.mt.mapper.MtTokenMapper;
import com.tudouji.project.mt.domain.MtToken;
import com.tudouji.project.mt.service.IMtTokenService;

/**
 * 美团TOKENService业务层处理
 * 
 * @author tudouji
 * @date 2024-01-19
 */
@Service
public class MtTokenServiceImpl implements IMtTokenService 
{
    @Autowired
    private MtTokenMapper mtTokenMapper;

    /**
     * 查询美团TOKEN
     * 
     * @param id 美团TOKENID
     * @return 美团TOKEN
     */
    @Override
    public MtToken selectMtTokenById(Long id)
    {
        return mtTokenMapper.selectMtTokenById(id);
    }

    /**
     * 查询美团TOKEN列表
     * 
     * @param mtToken 美团TOKEN
     * @return 美团TOKEN
     */
    @Override
    public List<MtToken> selectMtTokenList(MtToken mtToken)
    {
        return mtTokenMapper.selectMtTokenList(mtToken);
    }
    @Override
    public MtToken getLastTokenByConditions(MtToken mtToken)
    {
        return mtTokenMapper.getLastTokenByConditions(mtToken);
    }

    /**
     * 新增美团TOKEN
     * 
     * @param mtToken 美团TOKEN
     * @return 结果
     */
    @Override
    public int insertMtToken(MtToken mtToken)
    {
        mtToken.setCreateTime(DateUtils.getNowDate());
        return mtTokenMapper.insertMtToken(mtToken);
    }

    /**
     * 修改美团TOKEN
     * 
     * @param mtToken 美团TOKEN
     * @return 结果
     */
    @Override
    public int updateMtToken(MtToken mtToken)
    {
        mtToken.setUpdateTime(DateUtils.getNowDate());
        return mtTokenMapper.updateMtToken(mtToken);
    }

    /**
     * 批量删除美团TOKEN
     * 
     * @param ids 需要删除的美团TOKENID
     * @return 结果
     */
    @Override
    public int deleteMtTokenByIds(Long[] ids)
    {
        return mtTokenMapper.deleteMtTokenByIds(ids);
    }

    /**
     * 删除美团TOKEN信息
     * 
     * @param id 美团TOKENID
     * @return 结果
     */
    @Override
    public int deleteMtTokenById(Long id)
    {
        return mtTokenMapper.deleteMtTokenById(id);
    }
}
